import Vue from 'vue'
import router from '../common/router'
import http from '../common/http'
import store from '../common/store.js'
import common from '../common/common'
import App from './App.vue'
import RouterTab from 'vue-router-tab'
import ViewUI, { LoadingBar } from 'view-design'
import message from '../common/message.js'
import 'vue-router-tab/dist/lib/vue-router-tab.css'
import 'view-design/dist/styles/iview.css'
import './assets/bootstrap.min.css'
import './assets/main.css'
import * as echarts from 'echarts';
import Loadding from './components/loadding.vue'


Vue.component("Loadding",Loadding)
Vue.prototype.echarts = echarts
Vue.use(RouterTab)
Vue.use(ViewUI)
Vue.prototype.http = http
Vue.prototype.store = store
Vue.prototype.common = common
Vue.prototype.message = message
Vue.directive('preventReClick', {
  inserted(el, binding) {
    el.addEventListener('click', () => {
      if (el.style.pointerEvents !== 'none') {
        el.style.pointerEvents = 'none'
        setTimeout(() => {
          el.style.pointerEvents = ''
        }, 1000)
      }
    })
  },
})

if (process.env.NODE_ENV === 'local') {
  require('../common/mock.js')
}

new Vue({
  render: (h) => h(App),
  router,
  store,
}).$mount('#app')
